package bocchi.card;

import bocchi.BocchiCore;
import bocchi.base.BaseCustomCard;
import bocchi.base.BaseCustomPower;
import com.megacrit.cardcrawl.actions.common.GainBlockAction;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.AbstractPower;

public class LyricNote extends BaseCustomCard {
    public static final String RAW_ID = LyricNote.class.getSimpleName();
    public static final String GAME_ID = BocchiCore.getGameID(RAW_ID);

    public LyricNote() {
        super(RAW_ID);
    }

    @Override
    public void use(AbstractPlayer player, AbstractMonster monster) {
        BaseCustomPower power = new BaseCustomPower(RAW_ID, AbstractPower.PowerType.BUFF, player, magicNumber) {
            @Override
            public void onApplyPower(AbstractPower power, AbstractCreature target, AbstractCreature source) {
                if (power.type == PowerType.DEBUFF && source == owner && !power.ID.equals("Shackled") && !target.hasPower("Artifact")) {
                    this.flash();
                    addToTop(new GainBlockAction(player, player, amount));
                }
            }
        };
    }
}